from constant import *
import math



def Spectral_Density(w, parameters):
	""" return spectral density with specified w"""
	mode = parameters[0]
	if mode == 0:
		# for Lorentz Density
		lamda = parameters[1]
		gamma = parameters[2]	
        	return 2 * lamda * w * gamma / (w * w + gamma * gamma) * hbar
	if mode == 1:
		# for Ohmic Density
		coeff = parameters[1]
		wc = parameters[2]
		return 0.5 * PI * coeff * w * math.exp(-1.0 * w / wc) * hbar
